import Vue from 'vue'
import VueRouter from 'vue-router'
import Find from '@/views/Find'
import My from '@/views/My'
import Friend from '@/views/Friend'
import Song from '@/views/Song'
import Is404 from '@/views/Is404'

Vue.use(VueRouter)

const routes = [
  {
    // 重定向
    path: '/',
    redirect: '/find'
  },
  {
    path: '/find',
    component: Find
  },
  {
    path: '/my',
    component: My
  },
  {
    path: '/friend',
    component: Friend
  },
  {
    path: '/song/:id',
    component: Song
  },
  {
    // 404页面  * 表示通配符
    path: '*',
    component: Is404
  }
]

const router = new VueRouter({
  routes
})

export default router
